<!-- PAGE CONTENT WRAPPER -->
<div class="page-content-wrap">
  <div class="row">
    <div class="col-md-12">
      <!-- START BASIC TABLE SAMPLE -->
      <div class="panel panel-default">
        <div class="panel-heading">
            <div class="row">
                <div class="col-md-12">
                    <h4 class="pull-left"><span class="fa fa-cog"></span> <%= t('zerocms.admin.settings.list_sites') %></h4>
                    <%= link_to raw("<i class='fa fa-plus'></i> #{t('zerocms.admin.sites.add_site')}"), {action: :new}, class: "btn btn-primary pull-right zerocms_ajax_request" %>
                </div>
            </div>
        </div>
        <div class="panel-body">
          <table class="table table-responsive table-hover table-striped">
            <thead>
            <tr>
                <th><%= t('zerocms.admin.table.id') %></th>
                <th><%= t('zerocms.admin.table.site_name') %></th>
                <th><%= t('zerocms.admin.table.slug') %></th>
                <th><%= t('zerocms.admin.table.description') %></th>
                <th><%= t('zerocms.admin.table.default') %></th>
                <th><%= t('zerocms.admin.table.status') %></th>
                <th><%= t('zerocms.admin.table.actions') %></th>
                <th></th>
            </tr>
            </thead>
            <tbody>
            <% @sites.decorate.each do |f| %>
                <tr data-id=<%= f.id %>>
                    <td><%= f.id %></td>
                    <td><%= f.the_title %></td>
                    <td><%= f.slug %></td>
                    <td><%= f.the_description %></td>
                    <td><%= (f.main_site?)? true : false %></td>
                    <td><%= f.the_status %></td>
                    <td>
                        <%= link_to raw('<i class="fa fa-pencil"></i>'), {action: :edit, id: f.id }, class: "btn btn-default btn-xs zerocms_ajax_request", title: "#{t('zerocms.admin.button.edit')}" %>
                        <%= link_to raw('<i class="fa fa-times"></i>'), { action: :destroy, id: f.id },
                                    method: :delete, data: { confirm: t('zerocms.admin.message.delete_item') }, class: "btn btn-danger btn-xs zerocms_ajax_request", title: "#{t('zerocms.admin.button.delete')}" unless current_site.id == f.id %>
                    </td>
                    <td>
                        <a target="_blank" class="btn btn-info btn-xs" href="<%= f.the_url %>" target="_blank" title="<%= t("zerocms.common.visit") %>"><i class="fa fa-eye"></i></a>
                        <a target="_blank" class="btn btn-primary btn-xs" href="<%= f.the_admin_url %>" target="_blank" title="<%= t("zerocms.admin.sidebar.dashboard") %>"><i class="fa fa-dashboard"></i></a>
                    </td>
                </tr>
            <% end %>

            </tbody>
          </table>
          <%= content_tag("div", raw(t('zerocms.admin.message.data_found_list')), class: "alert alert-warning") if @sites.empty? %>
            <%= raw zerocms_do_pagination(@sites) %>
        </div>
      </div>
      <!-- END BASIC TABLE SAMPLE -->
    </div>
  </div>

</div>